#ifndef __COMPUTER_H__
#define __COMPUTER_H__
#include <string.h>  //strcpy位于该头文件中
#include <iostream>

using std::cout;
using std::endl;

class Computer
{
public:
    //在类内部定义的成员函数都是inline函数
    void setBrand(const char * brand)
    {
        strcpy(_brand, brand);
    }

    void setPrice(double price)
    {
        _price = price;
    }

    void print() 
    {
        cout << "brand:" << _brand << endl;
        cout << "price:" << _price << endl;
    }

private:
    char _brand[20];
    double _price;
};
#endif
